package com.xlh.support.quiz.constant;

/**
 * 随堂提问评价
 *
 * @author cheer
 */
public enum QuizPerformanceEnum {

    CORRECT(1, "正确"),
    INCORRECT(2, "不正确"),
    EXCELLENT(3, "优秀"),
    GOOD(4, "良好"),
    POOR(5, "差"),
    ABSENT(6, "旷课");

    private Integer code;

    private String message;

    public static QuizPerformanceEnum forCode(Integer code) {
        if (code == null) {
            return null;
        }

        for (QuizPerformanceEnum quizPerformanceEnum : QuizPerformanceEnum.values()) {
            if (quizPerformanceEnum.code.equals(code)) {
                return quizPerformanceEnum;
            }
        }
        return null;
    }

    QuizPerformanceEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
